package Utils.upload;

public class Section {
	String name,fileName,date,savedFileName;
	String value, contentType;
	
	public Section(String name, String filename) {
		this.name = name;
		this.fileName = filename;
	}
	
	public String getContentType() {
		return contentType;
	}
	
	public void setContentType(String v) {
		contentType = v;
	}
	
	public void setValue(String v) {
		value = v;
	}
	
	public void setSavedFileName(String v) {
		savedFileName = v;
	}
	
	public String getSavedFileName() {
		return savedFileName;
	}

	public String getName() {
		return name;
	}
	
	public String getFileName() {
		return fileName;
	}
	
	public String getValue() {
		return value;
	}
	
	public boolean isParameter() {
		return fileName == null;
	}
	
	public boolean isFile() {
		return fileName != null;
	}
	public String getEndFileName()
	{
		String a = this.getSavedFileName();
 		String []b = a.split("/");
 		a = b[b.length-1];
 		b = a.split("&npk");
 		a = b[b.length-1];
 		return a;
	}
	public String toString() {
		StringBuffer sb = new StringBuffer(1000);
		sb.append("name=");
		sb.append(name);
		sb.append("\n");
		sb.append("fileName=");
		sb.append(fileName);
		sb.append("\n");
		sb.append("value=");
		sb.append(value);
		sb.append("\n");
		sb.append("savedFileName=");
		sb.append(savedFileName);
		sb.append("\n");
		sb.append("contentType=");
		sb.append(contentType);
		sb.append("\n");
		return sb.toString();
	}
	/**
	 * @param string
	 */
	public void setFileName(String string) {
		fileName = string;
	}

}